|
How To: Redirect applications after data has been sent to the client
|
1. Introduction
In ASP.NET, if you want to redirect to another application, this is only possible with Response.Redirect if nothing has been sent to the client yet. If you have called Response.Flush, or WaitMessageStart (which calls Reponse.Flush), you will get an error message if you try to redirect.
2. Example
This has become even more relevant with the usage of the ListView control
However, in many cases we need to redirect after sending data to the client, especially where we want to go to an application if a report or search has found exactly 1 record. To achieve this, you need to write client-side script that sets the window location.
This writing of client-side script to redirect, has now been put into the RedirectClient(URL As String) function in the base page class (Exact.Web.UI.Page.Base). An example:
Private Sub GetListData(ByVal sender As Object, ByVal e As EventArgs)
Dim data(,) As Object = conn.Query(qb.SQL)
Dim nRows As Integer: If Not IsNothing(data) Then nRows = UBound(data) + 1
If nRows = 1 Then
RedirectClient("WflRequest.aspx?BCAction=1&ID=" & data(0, 0))
Else
WriteResultTable()
End If
End Sub
|
3. Conclusion
Happy coding =)
Applies to
|
Main Category: |
Support Product Know How |
Document Type: |
Online help main |
Category: |
SDK |
Security level: |
All - 0 |
Sub category: |
General |
Document ID: |
09.807.931 |
Assortment: |
Exact Synergy Enterprise
|
Date: |
19-05-2018 |
Release: |
|
Attachment: |
|
Disclaimer |
|
|